<!--公司账户-->
<template>
  <div class="system">

    <div class="my_header">
      <i class="mui-icon mui-icon-arrowleft" aria-hidden="true" @click="$router.back(-1)"></i>
      <div class="top1">信息详情</div>
    </div>
    <div class="sysitem">
      <div class="title">{{msgdetail.type}}</div>
    </div>

    <div class="info">
      {{msgdetail.content}}
    </div>

    <div class="timerow">
      <div class="time">{{msgdetail.add_time}}</div>
    </div>


  </div>
</template>

<script>
  export default {

    data() {
      return {

        msgdetail: {},

      };
    },
    created: function () {
      var token = localStorage.getItem("token");
      var that = this;
      var msgid = this.$route.query.tabitem;
      that.getmsgdetail(msgid);
    },
    methods: {
      getmsgdetail(msgid) {
        console.log(msgid + "消息id");
        var that = this;

        $.ajax({
          type: "get",
          url: "http://zcapi.hrgsxt.cn/api/User_message/info",
          data: {
            token: localStorage.getItem("token"),
            message_id: msgid
          },
          cache: false,
          dataType: "json",
          success: function (data) {

            if (data.code == 200) {

              that.msgdetail = data.data;

              console.log(JSON.stringify(that.msgdetail));

            } else {

              that.$toast({
                message: data.message,
                duration: 1000
              })

            }

          }
        });
      }

    },

    watch: {
      // 如果路由有变化，会再次执行该方法
      '$route': 'fetchData'
    }
  }

  //图片上传并预览
</script>

<style scoped>

  .system {
    margin-top: 0.88rem;
    height: 100% !important;
    width: 100%;
    background-color: #FFFFFF;
    position: fixed;
  }

  .system .sysitem {
    background-color: #FFFFFF;
    padding-top: 10px;

  }

  .system .info {
    background-color: #FFFFFF;
    padding: 0px .31rem;
    color: #999999;
    font-size: 0.28rem;
    text-indent: 2em;
    line-height: .4rem;
  }

  .system .timerow {
    text-align: right;
    height: 0.88rem;
    line-height: 0.88rem;
    padding: 0px 0.5rem;
    color: #999999;
    font-size: 0.26rem;
  }

  .system .sysitem .title {
    height: 1rem;
    line-height: 1rem;
    color: #333333;
    text-align: center;
    font-size: 0.3rem;
  }

  .error {
    color: #FC355D;
  }

  /*查询记录*/

  .margintop10 {
    margin-top: 10px;
  }

  .my_header .top1 {
    margin-right: 20px;
  }

  .my_header {
    height: .88rem;
    background: rgba(0, 133, 240, 1);
    text-align: center;
    color: #fff;
    line-height: .88rem;
    position: relative;
    padding: 0 .3rem;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 999;
  }

  .my_header i {
    font-size: .4rem;
    float: left;
    line-height: .88rem;
  }

  .myaccount .my_header .top1 {
    width: 40%;
    margin-left: 25%;
    float: left;
    text-align: center;
  }

  .myaccount .my_header .cmaccount {
    float: right;
    font-size: 0.28rem;
  }
</style>
